﻿<%@ WebHandler Language="C#" Class="reminder" %>

using System;
using System.Web;

public class reminder : IHttpHandler {
    
    public void ProcessRequest (HttpContext context) {
        context.Response.ContentType = "text/json";
        string id = HttpContext.Current.Request.Params["id"];
        string act = HttpContext.Current.Request.Params["act"];
        string data_optio = HttpContext.Current.Request.Params["data_optio"];
        UpData(id, data_optio);
        context.Response.Write("{\"code\":1,\"msg\":\"\u63d0\u9192\u6210\u529f\"}");
    }

    MsSqlHelper mssql = new MsSqlHelper();

    public void UpData(string id,string data_optio)
    {
        string sql="";
        switch(data_optio){
            case "fp":
                sql = "update spls_ck set remind_fp='1' where plh='" + id + "'";
                break;
            case "sh":
                sql = "update spls_ck set remind_sh='1' where plh='" + id + "'";
                break;
            case "pj":
                sql = "update spls_ck set remind_pj='1' where plh='" + id + "'";
                break;
            case "bg":
                sql = "update spls_ck set remind_bg='1' where plh='" + id + "'";
                break;
            default:
                sql = "select 1 as biaoshi ";
                break;   
        }
        if(!string.IsNullOrEmpty(sql)){
            mssql.ExecuteSql(sql) ;
        }
    }
 
    public bool IsReusable {
        get {
            return false;
        }
    }

}